﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.IO;

namespace Avanade.ViddlerDotNet
{
    public class ViddlerException : Exception
    {
        private int code;

        public int Code
        {
            get { return code; }
            set { code = value; }
        }

        internal ViddlerException(int code, string message)
            : base(message)
        {
            this.code = code;
        }

        public static ViddlerException GetFromErrorObject(Error error)
        {
            return new ViddlerException(error.Code, error.Description);
        }
    }
}
